<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件绑定</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="Application">
       <div>点击次数:{{count}}</div>
       <button @click="click(2), log($event)">点击</button>
       <div @click.capture.stop="click1" style="border:solid red">
            外层
           <div @click.capture.stop="click2" style="border:solid red">
               中层
               <div @click.capture.stop="click3" style="border:solid red">
                   点击
               </div>
           </div>
       </div>
    </div>
    <script>
        const {createApp, ref} = Vue
        const config = {
            setup() {
                const count = ref(0)
                const click = (step) => { 
                    count.value += step
                }
                const log = (event) => {
                    console.log(event)
                }
                const click1 = () => {
                    console.log("外层")
                }
                const click2 = () => {
                    console.log("中层")
                }
                const click3 = () => {
                    console.log("内层")
                }
                return {count, click, click1, click2, click3, log}
            }
        }
        createApp(config).mount("#Application") 
    </script>
</body>
</html>